The Lowdown on Newton™ An introduction to Newton error messages and basic NewtonScript™ programming Exception Types In some error codes, you may see reference to NewtonScript 'frames'. Those identified could include: |evt.ex.fr| a frames exception |evt.ex.fr;type.ref.frame| a frames exception with frame data |evt.ex.fr.type| an exception generated by a bad data type |evt.ex.fr.type;type.ref.frame| a similar bad type exception, with frame data |evt.ex.fr.comp| an exception from the compiler |evt.ex.fr.intrp| an exception from the interpreter |evt.ex.fr.intrp;type.ref.frame| an exception from the interpreter, with frame data |evt.ex.fr.store| an exception for the storage manager. Error Codes Store Errors - related to stores NOTE: the 'soup' is the database of 'persistent' objects in the store -48002 store format is too old to understand -48003 store format is too new to understand -48004 store is corrupted, cannot recover -48005 single object is corrupted, cannot recover -48009 not a soup entry -48010 tried to remove a store that was not registered -48011 soup index has an unknown type -48012 soup index has an unknown key structure -48013 soup index does not exist -48014 a soup with this name already exists -48015 tried to CopyEntries to an unknown soup -48016 soup is invalid (probably from a removed store) -48017 soup is invalid (probably from a removed store) -48018 entry is invalid (probably from a removed store) -48019 key does not have the type specified in the index -48020 store is in ROM -48021 soup already has an index with this path -48022 internal error - something unexpected happened (probably hit by a Holy Hand-Grenade) -48023 tried to call RemoveIndex on the _uniqueID index -48024 query type missing or unknown -48025 discovered index inconsistency Object System Errors -48200 expected a frame, array, or binary object, but got something else -48202 empty path -48203 invalid segment in path expression -48204 path failed -48205 index out of bounds (string or array) -48206 source and destination must be different objects -48207 long out of range (too large or small) -48210 bad arguments -48211 string too big -48214 object is read-only -48215 functionality is unimplemented Bad Type Errors -48400 expected a frame -48401 expected an array -48402 expected a string -48403 expected a pointer -48404 expected a number -48405 expected a real -48406 expected an integer -48407 expected a character -48408 expected a binary object -48409 expected a path expression (or a symbol or integer) -48410 expected a symbol -48411 expected a symbol -48412 expected a frame or an array -48413 expected an array or Nil -48414 expected a string or Nil -48415 expected a binary object or Nil -48416 unexpected frame -48417 unexpected binary object -48418 unexpected immediate -48499 unexpected Spanish Inquisition Interpreter Errors -48800 not in a break loop, but presumably called break -48802 too many arguments for a CFunction -48803 wrong number of arguments -48804 FOR loop BY expression has value zero -48806 no current exception -48807 undefined variable -48808 undefined global function -48809 undefined method -48810 no _proto for inherited send -48811 tried to access slot in Nil context -48814 local variables and FOR/WITH loops are not allowed at top level NewtonScript Data Types integers - in the range -(2^29 - 1) to 2^29 - 1. Can be represented in hexadecimal, using the format 0xNNNN, e.g. 0x1F4A. reals - SANE double floating point numbers, 15-16 digit, with exponents in the range -308 to 308. Must be given as a number with a decimal point (e.g. 4. and 6.9035) or in exponential form (e.g. 4.55e7). characters - given as e.g. $a for 'a', $7 for '7', or in unicode escape chars. NewtonScript Integer Math << shift left >> shift right * multiply div integer divide mod remainder divide + add - subtract Random(low, high) returns a random number between low and high. NewtonScript Floating Point Math * multiply / floating point divide + add - subtract Unary (arity 1) functions are used as 'function(argument)' and include: Acos, Asin, Atan, Cos, Cosh, Exp, Log, Log10, Sin, Sinh, Sqrt, Tan, Tanh, Acosh, Asinh, Atanh, Erf, Erfc, Expm1, Gamma, LGamma, Logb, Log1p. Binary (arity 2) functions are used as 'function(arg1, arg2)' and include: Atan2(x,y), Fmod(x,y), Pow(x,y), Hypot(x,y), Remainder(x,y), Annuity(rate,periods), Compound(rate,periods). Ord(char) returns the Unicode value of the character passed. Chr(unicode) returns the character for a given Unicode value. NewtonScript Miscellanea GC() calls a garbage collection of memory. Caution Using NewtonScript directly into a Newton device may damage your, and your Newton's, health. You should only attempt to do what you know yourself to be capable of. Only run NewtonScript programs on a Newton which has been fully backed up using a reliable method. You have been warned! NewtonScript is a trademark of Apple Computer, Inc. The information provided here has been drawn from manuals which are © Apple Computer, Inc. The copyright holder should be consulted for permission for any further reproduction. These shortcuts have been compiled by Howard Oakley of EHN & DIJ Oakley They are presented in good faith and without liability, but with the occasional help of the Monty Python team Contact EHN & DIJ Oakley V oice: +44 983 853605 Fax: +44 983 853253 CompuServe: 70734,120 AppleLink: UK0392 Internet: Howard@quercus.demon.co.uk 11 August 1993